"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.name = void 0;
var GeCi1 = [
    {
        text: '一瞬间',
        time: 20.812
    },
    {
        text: '法则颠覆',
        time: 52421.234
    }
];
/**
 * @description 练习类型约束 使用type 前缀 可以约束引用数据类型的子类型
 * @param GeCiArr
 * @return GeCiType[]
 */
function renderGeCi(GeCiArr) {
    var gcIndex = 0;
    var gc = [];
    while (gcIndex < GeCiArr.length + 1) {
        console.log('歌词解析...\n\n\n');
        gc.push(GeCiArr.pop());
        gc.push({ text: 'oh!!!', time: new Date().getTime() });
        gcIndex++;
    }
    return __spreadArray([], gc.reverse(), true);
}
var name = 'james';
exports.name = name;
var delayExecFn = function (fn, delay) {
    var args = [];
    for (var _i = 2; _i < arguments.length; _i++) {
        args[_i - 2] = arguments[_i];
    }
    setTimeout(function () {
        fn('args');
    }, delay);
};
delayExecFn(function (args) {
    console.log(args);
}, 3000, 'why', 18);
/**
 * 元组与数组的区别,数组存放相同数据类型 元组存放不同数据类型 通常用在函数返回值
 * @function testTuple
 * @description 一个函数 约束返回值为元组其中有三个子项 分别为 字符串 数字 自定义函数 类型
 */
function testTuple(a, b) {
    var arr0 = [a, b]; //array
    var t = ['gqq', 18, function () {
        }, function () {
        }]; //tuple
    return [arr0[0], t[1], function () {
        }];
}
var person = {
    name: 'GWW',
    age: 19,
    length: 18,
    unit: ['厘米', '米']
};
var P = /** @class */ (function () {
    function P() {
    }
    return P;
}());
var p = new P();
p.age = 19;
testTuple('1', '2');
console.log(p);
